//
//  myView.m
//  myTabBarController
//
//  Created by 苗钧豪 on 16/7/23.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "myView.h"
#import "ViewController.h"
#define WIDTH self.bounds.size.width
#define HEIGHT self.bounds.size.height
@implementation myView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.frame = CGRectMake(0, 0, 414, 44);
        self.backgroundColor = [UIColor whiteColor];
        UIButton *btn1 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [btn1 setBackgroundImage:[UIImage imageNamed:@"1"] forState:(UIControlStateNormal)];
        btn1.frame = CGRectMake(0, 0, WIDTH / 5, HEIGHT);
        [self addSubview:btn1];
        
        UIButton *btn2 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [btn2 setBackgroundImage:[UIImage imageNamed:@"2"] forState:(UIControlStateNormal)];
        btn2.frame = CGRectMake(WIDTH / 5, 0, WIDTH / 5, HEIGHT);
        [self addSubview:btn2];

        UIButton *btn3 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [btn3 setBackgroundImage:[UIImage imageNamed:@"3"] forState:(UIControlStateNormal)];
        btn3.frame = CGRectMake(WIDTH / 5 * 2, 0, WIDTH / 5, HEIGHT);
        [self addSubview:btn3];

        UIButton *btn4 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [btn4 setBackgroundImage:[UIImage imageNamed:@"4"] forState:(UIControlStateNormal)];
        btn4.frame = CGRectMake(WIDTH / 5 * 3, 0, WIDTH / 5, HEIGHT);
        [self addSubview:btn4];

        UIButton *btn5 = [UIButton buttonWithType:(UIButtonTypeSystem)];
        [btn5 setBackgroundImage:[UIImage imageNamed:@"5"] forState:(UIControlStateNormal)];
        btn5.frame = CGRectMake(WIDTH / 5 * 4, 0, WIDTH / 5, HEIGHT);
        [self addSubview:btn5];

    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
